Imports System.Web
Imports System.Xml
Imports System.Collections.Generic
Imports System.Security.Cryptography
Imports System.Web.Configuration
Imports DnnPerm = DotNetNuke.Security.Permissions
Imports DnnRoles = DotNetNuke.Security.Roles
Imports DnnFS = DotNetNuke.Services.FileSystem
Imports System.ServiceModel
Imports System.Runtime.Serialization

Namespace DotNetNuke.Modules.IWebCF

    <DataContract(), Serializable()> _
    Public Class FileInfoDataContract
        Implements IWebFileInfo
        Private info As New DnnFS.FileInfo
        Private lastModifiedField As Date = Now


        Public Sub New()

        End Sub

        Public Sub New(ByVal folderId As Integer, ByVal fileId As Integer, ByVal fileName As String)

            Me.info.FolderId = folderId
            Me.info.FileId = fileId
            Me.info.FileName = fileName


        End Sub

        Public Sub New(ByVal info As DnnFS.FileInfo)
            Me.info = info

            Me.LastModified = IO.File.GetLastWriteTime(Me.info.PhysicalPath)


        End Sub


        '''<remarks/>
        ''' 
        <DataMember()> _
        Public Property ContentType() As String Implements IWebFileInfo.ContentType
            Get
                Return Me.info.ContentType
            End Get
            Set(ByVal value As String)
                Me.info.ContentType = value
            End Set
        End Property


        '''<remarks/>
        ''' 
        <DataMember()> _
        Public Property Extension() As String Implements IWebFileInfo.Extension
            Get
                Return Me.info.Extension
            End Get
            Set(ByVal value As String)
                Me.info.Extension = value
            End Set
        End Property

        <DataMember()> _
        Property LastModified() As Date Implements IWebFileInfo.LastModified
            Get
                Return Me.lastModifiedField
            End Get
            Set(ByVal value As Date)
                Me.lastModifiedField = value
            End Set
        End Property


        '''<remarks/>
        ''' 
        <DataMember()> _
        Public Property FileId() As Integer Implements IWebFileInfo.FileId
            Get
                Return Me.info.FileId
            End Get
            Set(ByVal value As Integer)
                Me.info.FileId = value
            End Set
        End Property

        '''<remarks/>
        ''' 
        <DataMember()> _
        Public Property FileName() As String Implements IWebFileInfo.FileName
            Get
                Return Me.info.FileName
            End Get
            Set(ByVal value As String)
                Me.info.FileName = value
            End Set
        End Property

        '''<remarks/>
        ''' 
        <DataMember()> _
        Public Property FolderId() As Integer Implements IWebFileInfo.FolderId
            Get
                Return Me.info.FolderId
            End Get
            Set(ByVal value As Integer)
                Me.info.FolderId = value
            End Set
        End Property


        '''<remarks/>
        ''' 
        <DataMember()> _
        Public Property Height() As Integer Implements IWebFileInfo.Height
            Get
                Return Me.info.Height
            End Get
            Set(ByVal value As Integer)
                Me.info.Height = value
            End Set
        End Property

        '''<remarks/>
        ''' 
        <DataMember()> _
        Public Property Size() As Integer Implements IWebFileInfo.Size
            Get
                Return Me.info.Size
            End Get
            Set(ByVal value As Integer)
                Me.info.Size = value
            End Set
        End Property

        '''<remarks/>
        ''' 
        <DataMember()> _
        Public Property Width() As Integer Implements IWebFileInfo.Width
            Get
                Return Me.info.Width
            End Get
            Set(ByVal value As Integer)
                Me.info.Width = value
            End Set
        End Property




    End Class
End Namespace
